<template>
  <section v-if="attachments && attachments.length">
    <el-col :span="2">
      <label class="labelSty">附件:</label>
    </el-col>
    <el-col :span="22">
      <upload-file-selector :is-onload="true"
                            :is-create="true"
                            :is-cover="true"
                            :is-disabled="true"
                            :attach-form="attachments"
                            @update:attach-form="handleInput"
                            v-bind="$attrs" />
    </el-col>
  </section>
</template>

<script>
import UploadFileSelector from "@/components/advance/upload/UploadFileSelector.vue";
export default {
  name: "attachments",
  components: { UploadFileSelector },
  inheritAttrs: true,
  props: ["value"],
  computed: {
    attachments () {
      return this.value || [];
    }
  },
  methods: {
    handleInput (attachments) {
      this.$emit("input", attachments);
    }
  }
};
</script>
